export ARCH=arm64#设置平台架构
export CROSS_COMPILE=aarch64-linux-gnu-#交叉编译器前缀
obj-m := timer_dev.o
# KDIR :=/home/topeet/Linux/linux_sdk/kernel    #这里是你的内核目录        
APP = timer




KERN_DIR = /home/robin/work/kernel-rockchip-nanopi4-linux-v4.4.y


PWD ?= $(shell pwd)
all:
	make -C $(KERN_DIR) M=$(PWD) modules    #make操作
	aarch64-linux-gnu-gcc $(APP).c -o $(addsuffix .out, $(APP))


install:
	scp *.ko $(TARGET) root@192.168.107.61:/drv_code

clean:
	make -C $(KERN_DIR) M=$(PWD) clean    #make clean操作
	$(RM) $(addsuffix .out, $(APP))
